package sk.isomi.jcf;

import java.util.Comparator;

import sk.isomi.minihr.entities.Employee;

public class CompareEmployeeById implements Comparator<Employee> {
	public static int ASC = 0;
	public static int DESC = 1;
	private int order;
	
	public CompareEmployeeById(int order) {
		this.order = order;
	}
	
	@Override
	public int compare(Employee o1, Employee o2) {
		//FIXME check for NULL
		return (order == ASC) ? o1.getId().compareTo(o2.getId()) : o2.getId().compareTo(o1.getId());
	}

}
